package com.cloud.lan.api;

import com.cloud.lan.api.dto.req.BaseReq;
import com.cloud.lan.entity.base.BaseResponse;
import com.cloud.lan.entity.model.dataobject.LanBookingActivityRecordDO;
import com.cloud.lan.service.ILanBookingActivityService;

import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import lombok.extern.slf4j.Slf4j;

/**
 * 预约活动API
 * Created by zhouquan on 2022/5/1.
 */
@Slf4j
@RestController
@RequestMapping(value = {"/v1/booking/activity/"}, method = {RequestMethod.GET, RequestMethod.POST}, consumes = {"*/*"}, produces = {"application/json"})
public class LanBookingActivityApi {

    @Resource
    private ILanBookingActivityService iLanBookingActivityService;

    @RequestMapping("queryLatestValidAC")
    public BaseResponse<Object> queryLatestValidAC(@RequestHeader(BaseReq.ut) String token, String appCode) {
        return iLanBookingActivityService.queryLatestValidAC(token,appCode);
    }

    @RequestMapping("queryUserLatestACR")
    public BaseResponse<Object> queryUserACR(@RequestHeader(BaseReq.ut) String token, Long activityId) {
        return iLanBookingActivityService.queryUserLatestACR(token,activityId);
    }

    @RequestMapping("applyJoin")
    public BaseResponse<Object> joinAC(@RequestHeader(BaseReq.ut) String token, LanBookingActivityRecordDO reqDo) {
        return iLanBookingActivityService.applyJoin(token,reqDo);
    }

}
